home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Graphics Plus
/
Graphics Plus.iso
/
general
/
viewers
/
polyview
/
plyvw102.lha
/
PolyView1.02
/
polyview.1
< prev
next >
Wrap
Text File
|
1991-07-02
|
16KB
|
466 lines
1.1 NCSA PolyView
NCSA PolyView Basics 1.1
National Center for Supercomputing Applications
August 1990
1.1 NCSA PolyView
NCSA PolyView Tutorial 1.1
August 1990
Chapter 1 NCSA PolyView Tutorial
Chapter Overview
Starting NCSA PolyView
Getting Around
Camera Movement
Palette Manipulation
Using the View Menu
Drawing Options
Viewing Projections
Shading Data
Creating Overlays
Animating Datasets
Taking a Flight
Taking Snapshots
Using Other Options
Exiting NCSA PolyView
Chapter Overview
This chapter offers a tutorial which introduces some of NCSA
PolyView's capabilities.
The tutorial assumes that you are able to work with 4Sight, the SGI
window manager, and IRIX, the SGI version of UNIX. If you are
unfamiliar with either system, please refer to their respective
documentation.
Starting NCSA PolyView
This section describes how to start PolyView using a sample data
file. Please refer to Appendix A, "Installing NCSA PolyView," if
you need information on installation procedures.
The following steps explain how to run PolyView using data
provided for the tutorial:
1. Begin by moving to the directory that contains PolyView and
the tutorial files. If you built the PolyView tar file from
anonymous FTP or loaded a directory from source tapes, the
directory should be named src.
2. Enter an ls command at the prompt to get a listing of the
directory's contents. For this tutorial, you'll work with the
HDF Vset file demo.hdf and the associated fly file demo.fly.
If demo.hdf is missing, run make again and it will generate
the file.
3. Enter polyview -hdf demo.hdf -scalar random -fly
demo.fly at the prompt, where:
Ñ polyview is the name of the program
Ñ -hdf demo.hdf tells the program to read data from the
demo.hdf file
Ñ -scalar random tells the program to load a vdata called
random from the file and use it as a set of scalar values
Ñ -fly demo.fly tells the program that the name of the file
used to script fly-bys is demo.fly.
PolyView reads the file's contents and list the names of vdatas as
it loads them.
A red outline of the View window appears. Moving the mouse
allows you to drag the outline to where you want the window to be
placed.
4. Click the left button when the window is where you want it. The
shaded border and title of the window will appear, but the
window will remain empty for now. The file name
"demo.hdf" should be visible in the title bar.
A red outline of the Palette window appears. Place it the same way
you placed the View window.
PolyView now fills in the View and Palette windows. Initially, the
View window displays a title screen (Figure 1.1). Click the left
button within the window to remove this screen.
Figure 1.1 View Window
The View window displays the demonstration dataset that
PolyView loaded. When the program starts up, the program
chooses a default camera location and set of viewing parameters
(Figure 1.2).
Figure 1.2 Initial View
The Palette window displays a bar reflecting the current palette
(Figure 1.3). The bar is labelled with values corresponding to
range of colors in the palette and the image.
Figure 1.3 Palette Window
Getting Around
This section of the tutorial demonstrates how to interact with the
data using the mouse and pop-up menus.
Note that mouse control, menus, and command line parameters
all allow you to control viewing parameters. However, this section
only focuses on the interactive features of PolyView. For more
information on command lines, refer to Chapter 2, "Command
References."
This portion of the tutorial assumes that PolyView is running
using the demonstration data, as described in the previous section.
Camera Movement
The initial view of the data is chosen automatically by the
program. The view is defined by two things: your camera position
and the focus of the camera's attention (these are also referred to as
the from and at points, respectively).
The camera position determines where the image in the View
window is "taken from." The camera's focus determines what the
camera is "pointing at" when the image is generated. Try
manipulating the camera position and the focus.
Place the cursor arrow in the center of the View window. Move the
camera in towards the focus by holding down the left mouse button
and pushing the mouse backward. You should see the row of cubes
moving closer.
Move the camera back from the focus by holding down the left
mouse button again, but this time moving the mouse forward. The
row of cubes should move farther away from the camera.
Move the camera around the focus point by holding down the
middle mouse button and moving the mouse. Moving the mouse
left and right shifts the camera so that the data appears to rotate to
the left or right.
Likewise, moving the mouse forward or backward moves the
camera, giving the illusion that the data is rotating up or down
around the focus point .
Experiment with using the left and middle mouse buttons to
maneuver the camera around the data. Try to move the camera to
produce views that you are interested in. See if you can position the
camera inside the tunnel of cubes or in top, side, front, and
isometric views.
Palette Manipulation
Moving the camera around the data provides fresh perspectives on
the data's geometry. You can gain additional insight into the
distribution of scalar values from using features available in the
Palette window.
Move the cursor into the Palette window. Note again how the scalar
values are mapped to the colors in the palette, with the smallest
scalar values corresponding to the lowest palette colors and the
largest scalar values corresponding to the highest palette colors.
Hold down the right mouse button. The palette menu appears
(Figure 1.4). The palette menu allows you to change the currently
active palette by selecting a new one from its list. Choose the gray
palette by moving the cursor over it and releasing the mouse
button. The color bar changes to a grey-scale palette. Note that the
colors in the image have changed to the corresponding palette.
Figure 1.4 Palette Submenu
With the cursor in the Palette window, hold down the middle mouse
button. This action places the Palette window in fiddle mode.
Moving the mouse forward and backward shifts the colors in the
palette up and down the scale. While you shift the palette, watch
what effect it has on the data in the View window.
Once again, with the cursor in the Palette window, hold down the
middle mouse button. Move the mouse left and right. Observe how
the palette in both the Palette and View windows compresses and
expands as the mouse moves.
Experiment with the fiddle feature to draw out details in the
random scalar values that are displayed as color. Try changing
the camera position to see how "fiddling" affects different areas of
the data. When you are done, choose rainbow from the palette menu
to return the palette to normal.
Using the View Menu
Besides manipulating a palette, you can change other image
parameters in the View menu to make it much easier to
understand what is happening to scalar values in an image
dataset.
Display the View menu (Figure 1.5) by moving the cursor into the
View window and holding down the right mouse button.
The View menu contains a number of options for changing the
appearance of the data. The first five options control display
parameters. The next set of menu items allow you to control
animation; toggle a flight; pop or redraw a window; reset the
window's display parameters; or write the image to an HDF raster
image file.
Figure 1.5 View Menu
Drawing Options
PolyView displays polygons, if possible, when the program starts
up. Move the cursor to the draw submenu and choose the points
option (Figure 1.6). The data in the View window should change to
a set of dots, one at each polygon vertex.
Figure 1.6 Draw Submenu
Displaying images as points is useful for positioning large sets of
data. It can be difficult to move the camera interactively while
drawing polygons, since they take longer to draw. Try moving the
camera and notice how much faster the screen redraws when you
choose the points option.
Occasionally it is desirable to display 3D data that has no
connectivity information associated with it. In these cases,
PolyView defaults to drawing points.
Choose lines from the draw submenu. PolyView redraws the data
in wireframe. Like the points option, lines display large sets of
data more quickly than polygons. In addition, lines have the
added benefit of displaying how the points are connected.
Choose polygons from the draw submenu. The View window again
displays filled polygons.
Viewing Projections
Up until this point in the tutorial, the program has drawn all the
images using a perspective projection; that is, polygons closest to
the camera appear larger, while more distant objects appear
smaller. You can choose different viewing projections from the
project submenu.
The project submenu (Figure 1.7) allows you to change the
projection used when drawing the data. Choose the orthographic
option from this submenu. PolyView uses the orthographic
projection to redraw the displayed data. Try moving the camera
with this new projection to see how it differs from a perspective
projection.
Figure 1.7 Projections
Submenu
Choose the perspective option from the project submenu to restore the
view to its initial projection.
Shading Data
At this point, polygons in the image should have a smoothly colored
appearance. Colors are interpolated across their surfaces using
gouraud shading. You can control polygonal shading using the
shade submenu (Figure 1.8).
Figure 1.8 Shade Submenu
Choose the constant option from the shade submenu. The polygons
in the image lose their smeared appearance and gain constant
color values. PolyView averages the color values at the vertices to
produce the constant color used in the new image.
Constant shading also makes the outline of individual polygons
more apparent.
This shading also has an interesting effect on the data when it is
displayed in lines mode. Choose the lines option from the draw
submenu. Notice that the View window now displays the data as a
wireframe drawn in white.
Choose the polygons option from the draw submenu to return to
constant shaded polygons. Next choose the gouraud option from the
shade submenu to return the View window to its initial state.
NOTE: Look at the palette submenu and note that it is the same
menu available from the Palette window. These identical menus
let you avoid returning to the Palette window when experimenting
with the palette.
Creating Overlays
Thus far, PolyView has only displayed image data in the View
window. The program, however, allows you to add other elements
to the display to aid in its understanding. You can choose these
options from the overlay submenu (Figure 1.9).
Figure 1.9 Overlay Submenu
Begin by selecting the at point option from the submenu. A six-
pointed, 3D "jack") appears at the center of the scene in the View
window. This jack is the focus of the camera's attention. Try
moving the camera and notice how the point remains stable in 3D
space.
Select the at point option again, and notice that the jack has
disappeared from the View window. All options in the overlay
submenu toggle on and off, and work in a similar fashion.
Choose axes from the overlay submenu. A set of 3D axes appears,
with their origin located at the minimal corner of the data (i.e., the
point with the smallest x, y, and z coordinates in the dataset). The
axes are labelled with the names of the vdatas used to determine
each coordinate. In the currently displayed demonstration file,
those vdatas/axes are px, py, and pz.
With the axes still displayed, choose the labels option from the
overlay submenu. The labels that were displayed at the end of the
axes disappear.
Now choose the box option from the overlay submenu. The axes
disappear and are replaced by a box that contains the entire
dataset. This box provides a reference frame for dispersed or
poorly connected data, and provides a visual cue for orientation.
While the box is displayed, choose labels from the overlay
submenu. The labels reappears in the scene, this time at the
corners of the box where the axes used to end.
Choose box again, and the overlay disappears.
Finally choose outlines, the last option in the submenu. The View
window now displays all of the polygons as outlined in white.
You'll find the outlines option useful when you want to see the
original polygonal mesh while still displaying the object as a
solid.
Deactivate the outlines by choosing outlines again.
Animating Datasets
PolyView animates multiple datasets contained in an HDF Vset
file. The animate submenu provides animation controls. Using
the submenu, you can set the animation running backward or
forward for a single frame or a continuous "movie," or you can
stop the animation sequence once it has started.
NOTE: Because the demonstration file, demo.hdf, contains only
one frame, animation commands will have no effect in this
tutorial.
Taking a Flight
One of the most popular features of PolyView is the fly file, which
allows examination of image data as it moves the camera and
focus through 3D space.
The flight is entirely described by an ASCII file, and is chosen at
program startup by specifying the -fly switch on the command
line. This tutorial uses the demo.fly file, which is printed in
Appendix B, "Example Fly File."
Select the Fly option from the View menu. The flight described by
the fly file begins. The camera moves from its initial location, to
the end of a row of tetrahedrons, and then continues its flight
through the dataset.
Notice that both the camera and the camera's focus change as the
file executes. You can control the camera's position with from
statements in the fly file and the camera's focus with at
statements.
Open another shell window and display demo.fly using an editor
such as vi or emacs. See if you can follow the course of the flight
from the statements in the file.
Try changing viewing parameters from the View menu during the
flight. Note that the flight pauses while you select from the menu
and then continues once you select an item.
Select the Fly option again to stop the flight. Choosing Fly again
restarts the flight from the beginning.
Taking Snapshots
Another way you can relay results to others is through still raster
images. PolyView can write a still image of any scene from the
View window to an HDF 8-bit raster image format file. You may
then display, annotate, or make the image into a slide using other
NCSA software like NCSA Image, NCSA ImageIP,
NCSA X Image, and NCSA Layout.
Position the camera and select the viewing parameters for an
image that you find interesting. Choose the Write HDF option from
the View menu. PolyView creates a file called ris8.hdf that
contains the image and its associated palette.
Using Other Options
Occasionally, you will use the Pop, Redraw, and Reset options. Pop
brings the View window to the foreground, on top of all other
windows. Redraw regenerates the image in the View window in
case it gets corrupted. Reset returns the camera position and
camera focus to their start-up values and resets the viewing
parameters.
Exiting NCSA PolyView
You are now at the end of the tutorial. After experimenting further
with the program, you may wish to quit. Do so by either pressing the
Esc key while in the View or Palette windows, or by selecting the
quit submenu from the View menu.
In either case, the Confirm submenu (Figure 1.10) confirms any
effort to shutdown the program.
Figure 1.10 Confirm Menu
Choosing Yes, really! quits the program. No, not really leaves
PolyView running.